Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nav highlights in admin area #28

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Conversation

peteryates
Copy link
Member

@peteryates peteryates commented Jan 16, 2025

Now when we're deeply into the nested structure the primary nav highlights properly.

image

Changes

  1. redirect from /admin to /admin/teachers instead of just rendering the teachers list on /admin
  2. within the admin section nest ABs and Schools within Organisations so the structure matches the nav
  3. add active_when args to the service nav so nav items are appropriately highlighted

Copy link

Review app deployed to https://cpd-ec2-review-28-web.test.teacherservices.cloud

@peteryates peteryates added the Bug Something isn't working label Jan 16, 2025
In the nav we're nesting schools, ABs, DPs and LPs beneath
organisations so it makes sense for us to do it in the routes too, to
keep things consistent.

Also, there's no /admin page, we render admin/teachers here
instead. This means the nav won't know what's actually being shown
(without us hardcoding extra behaviour) so let's redirect instead.
This sets active to true for nav nodes when the beginning of the
current_path matches the active when path.
@peteryates peteryates force-pushed the fix-nav-highlights-in-admin-area branch from f565bbd to b6e5b21 Compare January 28, 2025 19:38
@peteryates peteryates enabled auto-merge January 28, 2025 19:38
@peteryates peteryates added this pull request to the merge queue Jan 28, 2025
Merged via the queue into main with commit a37795f Jan 28, 2025
16 checks passed
@peteryates peteryates deleted the fix-nav-highlights-in-admin-area branch January 28, 2025 19:44
Copy link

Review app ECF2 deployed to https://ec2-review-28-web.test.teacherservices.cloud was deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants